/**
 * Created by Administrator on 2017/8/16 0016.
 */
$(document).ready(function () {
    var D_height = $(document).height(); //浏览器时下窗口文档的高度
    var W_height = $(window).height(); //浏览器时下窗口可视区域高度
    var foot = $('footer');
    if (W_height - D_height > 0 || W_height - D_height == 0) {
        foot.css({
            'position': 'absolute',
            'bottom': '0',
            'left': '0'
        });
        $('main').height(W_height - $('header').height() - $('footer').height());
    } else {
        foot.css({
            'position': 'relative',
        });
        $('main').height(D_height - $('header').height() - $('footer').height());
    }
    //产品中心隐藏下拉菜单操作
    $('#tab2').hover(function () {
        $('#hideBox').show();
    }, function () {
        $('#hideBox').hide();
    });
    $('#hideBox').on('click', 'li', function () {
        switch ($(this).html()) {
            case "口罩":
                window.location.href = '/product/Mask/Default.aspx';
                break;
            default:
                window.open('/build/index.html');
                break;
        }

    });
    //获取product.html中url参数name的值
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]); return null;
    }


    childrenMask();
    componyVideo();

});

//儿童口罩
function childrenMask() {
    var window_Width = $(window).width();
    $('#childrenPic1').width((window_Width - 1200) / 2);
    $('#childrenPic2').width((window_Width - 1200) / 2);
}
//企业视频
function componyVideo() {
    $('#video').height($('main').height() - $('.main-title').height() - $('.main-logo').height());
}
//医疗口罩
function medicalMask() {
    $('#barList li').click(function () {
        $(this).addClass('on').siblings('li').removeClass('on');
    })
}